<template>
    <div class="contentar">
        <div class="reportList whiteBg">
            <div class="color999 fontSize12 subTitle">报表分类</div>
            <div class="w33 disInline center borderRight borderBtm" @click="goLink(1)">
                <img src="../../assets/image/totalReport.png" />
                <div class="fontSize15 fontbold">集团报表</div>
            </div>
            <div class="w33 disInline center borderRight borderBtm" @click="goLink(2)">
                <img src="../../assets/image/warehouseReport.png" />
                <div class="fontSize15 fontbold">区域日报表</div>
            </div>
            <div class="w33 disInline center borderBtm" @click="goLink(3)">
                <img src="../../assets/image/channelReport.png" />
                <div class="fontSize15 fontbold">渠道日报表</div>
            </div>
            <div class="w33 disInline center borderRight borderBtm" @click="goLink(4)">
                <img src="../../assets/image/onlineReport.png" />
                <div class="fontSize15 fontbold">线上日报表</div>
            </div>
        </div>
        
    </div>
</template>
<script>
import { Toast} from 'vant'
export default {
    data(){
        return{
            
        }
    },
    created(){
        let token=this.GetQueryString('token')
        console.log('token---------',token)
        if(token&&token!==''){
            localStorage.setItem('token',token)
        }
    },
    methods:{
        GetQueryString(name){
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r!=null)return  unescape(r[2]); return null;
        },
        goLink(type){
            let url=''
            type==1?url='/salesReport':''//集团报表
            type==2?url='/dailySalesWarehouse':'' //区域线下报表
            type==3?url='/dailyReportChannel':'' //渠道线下报表
            if(type==4){
                Toast('正在紧张开发中')
            }
            //type==4?url='/dailySalesOnLine':'' //线上报表
            this.$router.push(url)
        }
    }
}
</script>
<style lang='less' scoped>

.contentar{
    background-color: #f1f1f1;
    padding: 0.4rem 0;
    // width: 86%;
    // padding: 0.6rem 7%;
    // margin: 0.4rem auto;
    img{display: inline-block;}
    .w33{
        width: 33%;
        padding: 0.4rem 0;
        // border: 1px #eee solid;
    }
    .reportList{
        width: 90%;
        margin: 0 auto;
        padding: 0 0 0.4rem 0;
        border-radius: 0.2rem;
        .subTitle{
            padding: 0.2rem;
            border-bottom: 1px #eee solid;
        }
        .borderRight{border-right:1px #eee solid}
        .borderBtm{border-bottom:1px #eee solid}
    }
}
</style>